[x,y] = syms('x y');

expr1 = exp(x)*(sin(x)+cos(x));

symdiff(expr1, x, 2)

symdiff(expr1, x, x)

symdiff(x*x*y, x, y, x)